Method for processing rate group, method for charging for data service, and related device and system

ABSTRACT

Embodiments of the present invention provide a method for processing a rate group, a method for charging for a data service, and a related device and system, so as to enable a charging system to accurately charge for the data service when the rate group changes. The method includes: determining, by a gateway device, whether a rate group of a service data stream changes; and if the rate group of the service data stream changes, reporting, by the gateway device, charging data to the charging system, so that the charging system performs charging according to the charging data, where the charging data includes service usage information and a reporting reason for reporting the charging data, and the reporting reason indicates a change of the rate group.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.14/072,695, filed on Nov. 5, 2013, which is a continuation ofInternational Application No. PCT/CN2011/073756, filed on May 6, 2011.All of the afore-mentioned patent applications are hereby incorporatedby reference in their entireties.

TECHNICAL FIELD

The present invention relates to the field of communications, and inparticular, to a method for processing a rate group, a method forcharging for a data service, and a related device and system.

BACKGROUND

Large-scale deployment of 3rd generation mobile communications greatlydrives usage of a data service, and accurate charging of the dataservice is a basis for conduction of the data service. Policy andcharging control (Policy and Charging Control, PCC) is a set of policyand charging control mechanisms defined by the 3rd GenerationPartnership Project (3rd Generation Partnership Project, 3GPP). The coreof a PCC mechanism is as follows: When establishing a bearer for a datastream, a gateway (GateWay) device requests a charging control policy ofthe data stream from a policy and charging rules function (Policy andCharging Rules Function, PCRF); if an application function (ApplicationFunction, AF) provides service-layer information of a service for thePCRF, the PCRF generates a dynamic control policy for charging andservice data stream or determines a static control policy to beactivated for charging and service data stream, according to subscriberinformation stored in a subscription profile repository (SubscriptionProfile Repository, SPR), bearer-layer information provided by thegateway, certain local policies that are configured by an operator inthe PCRF and the service-layer information. The PCRF delivers a commandfor installing the generated dynamic policy or activating the determinedstatic policy stored in the gateway to a policy and charging enforcementfunction (Policy and Charging Enforcement Function, PCEF) in thegateway; and the PCEF performs, according to the installed/activatedpolicy, resource allocation, data stream control, and charging control.The PCC mechanism can implement, according to a policy of the operator,precise control on a service data stream, so as to implementfine-grained operation of bandwidth.

In the preceding PCC mechanism, the AF is a service network element, andprovides information related to a service accessed by a subscriber. Forexample, the AF can provide information such as a service identifier, aservice priority indication, and a service urgency indication for thePCRF.

In the PCC, the PCRF is a policy decision entity responsible forcontrolling QoS, bandwidth, gating, charging control policies, and so onwhen a user equipment uses a service in a home network, and generating adynamic policy or specifying a static policy, where the policy isexecuted by the policy and charging enforcement function.

The PCEF is a policy execution entity, and is configured to execute adynamic control policy delivered by the PCRF or a specified staticcontrol policy, and may be located in a gateway device, such as a GGSN,a P-GW, or a WAP gateway.

The SPR is a subscription data storage entity and stores subscriptiondata of the subscriber.

When the PCEF performs charging control, a case where a rate groupchanges may appear in certain scenarios. With regard to a change of arate group on a side of a network element, the prior art has notprovided an appropriate processing method for a charging system toperform charging. As a result, after the rate group changes, an existingcharging system fails to receive accurate information and then fails toperform precise processing according to the change of the rate group,thereby affecting charging accuracy. Meanwhile, because accurateprocessing cannot be performed on the change of the rate group, aproblem where partial traffic before service identification cannot beaccurately charged may appear in PCRF-based data service chargingcontrol.

SUMMARY

Embodiments of the present invention provide a method for processing arate group, a method for charging for a data service, and a relateddevice and system, so as to enable a charging system to accuratelycharge for the data service when the rate group changes.

An embodiment of the present invention provides a method for processinga rate group, including: determining, by a gateway device, whether arate group of a service data stream changes; and if the rate group ofthe service data stream changes, reporting, by the gateway device,charging data to a charging system, so that the charging system performscharging according to the charging data, where the charging dataincludes service usage information and a reporting reason for reportingthe charging data, and the reporting reason indicates a change of therate group.

An embodiment of the present invention provides a method for chargingfor a data service, including: receiving, by a charging system, chargingdata reported by a gateway device when the gateway device determinesthat a rate group of a service data stream changes, where the chargingdata includes service usage information and a reporting reason forreporting the charging data, and the reporting reason indicates a changeof the rate group; determining, by the charging system, a rate of theservice data stream according to the reporting reason and an originalrate group; and performing, by the charging system, fee deduction on theservice usage information according to the determined rate.

An embodiment of the present invention provides a method for chargingfor a data service, including: determining, by a policy and chargingrules function PCRF entity, according to an identification result ofidentifying a service, whether to charge at a network layer and todeliver a charging control policy to a gateway device after generatingthe charging control policy, so that the gateway device executes thecharging control policy; and regenerating, if the PCRF confirms that itis necessary to change the charging control policy, a charging controlpolicy, and delivering the charging control policy to the gatewaydevice.

An embodiment of the present invention provides a gateway device,including: a rate group change determining module, configured todetermine whether a rate group of a service data stream changes; and acharging data reporting module, configured to report, if the rate groupchange determining module determines that the rate group of the servicedata stream changes, charging data to a charging system, so that thecharging system performs charging according to the charging data, wherethe charging data includes service usage information and a reportingreason for reporting the charging data, and the reporting reasonindicates a change of the rate group.

An embodiment of the present invention provides a charging system,including: a charging data receiving module, configured to receivecharging data reported by a gateway device when the gateway devicedetermines that a rate group of a service data stream changes, where thecharging data includes service usage information and a reporting reasonfor reporting the charging data, and the reporting reason indicates achange of the rate group; a rate determining module, configured todetermine a rate of the service data stream according to the reportingreason and an original rate group; and a fee deducting module,configured to perform fee deduction on the service usage informationaccording to the determined rate.

An embodiment of the present invention provides a policy and chargingrules function entity, including: a determining module, configured todetermine, according to an identification result of identifying aservice, whether it is necessary to charge at a network layer and todeliver a charging control policy to a gateway device after generatingthe charging control policy, so that the gateway device executes thecharging control policy; and a charging control policy generatingmodule, configured to regenerate, if it is confirmed that it isnecessary to change the charging control policy, a charging controlpolicy, and to deliver the charging control policy to the gatewaydevice.

It can be seen from the preceding embodiments of the present inventionthat, a gateway device can determine whether a rate group of a servicedata stream changes, and when the rate group of the service data streamchanges, report charging data including a re-determined rate group to acharging system, so that the charging system performs charging accordingto the charging data. Therefore, compared with the prior art, the methodfor processing a rate group that is provided by the embodiments of thepresent invention can enable the charging system to know a change of therate group, thereby reducing impacts of the change of the rate group oncharging accuracy and making the charging more accurate.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention more clearly, the following briefly introduces theaccompanying drawings required for describing the embodiments.Apparently, the accompanying drawings in the following description showmerely some embodiments of the present invention, and persons ofordinary skill in the art may still derive other drawings from theseaccompanying drawings without creative efforts.

FIG. 1 is a schematic flowchart of a method for processing a rate groupaccording to an embodiment of the present invention;

FIG. 2 is a schematic flowchart of a method for charging for a dataservice according to an embodiment of the present invention;

FIG. 3 is a schematic flowchart of interaction of devices in a methodfor charging for a data service according to an embodiment of thepresent invention;

FIG. 4 is a schematic flowchart of interaction of devices in a methodfor charging for a data service according to another embodiment of thepresent invention;

FIG. 5 is a schematic flowchart of a method for charging for a dataservice according to another embodiment of the present invention;

FIG. 6 is a schematic flowchart of a method for charging for a dataservice according to another embodiment of the present invention;

FIG. 7 is a schematic flowchart of interaction of devices in a methodfor charging for a data service according to another embodiment of thepresent invention;

FIG. 8 is a schematic flowchart of interaction of devices in a methodfor charging for a data service according to another embodiment of thepresent invention;

FIG. 9 is a schematic diagram of a logical structure of a gateway deviceaccording to an embodiment of the present invention;

FIG. 10 is a schematic diagram of a logical structure of a gatewaydevice according to another embodiment of the present invention;

FIG. 11 is a schematic diagram of a logical structure of a gatewaydevice according to another embodiment of the present invention;

FIG. 12 is a schematic diagram of a logical structure of a gatewaydevice according to another embodiment of the present invention;

FIG. 13 is a schematic diagram of a logical structure of a gatewaydevice according to another embodiment of the present invention;

FIG. 14 is a schematic diagram of a logical structure of a chargingsystem according to an embodiment of the present invention;

FIG. 15 is a schematic diagram of a logical structure of a policy andcharging rules function entity according to an embodiment of the presentinvention; and

FIG. 16 is a schematic diagram of a logical structure of a policy andcharging rules function entity according to another embodiment of thepresent invention.

DESCRIPTION OF EMBODIMENTS

Embodiments of the present invention provide a method for processing arate group, a method for charging for a data service, and a relateddevice and system, so as to enable a charging system to accuratelycharge for the data service when the rate group changes.

The following clearly and describes the technical solutions in theembodiments of the present invention with reference to the accompanyingdrawings in the embodiments of the present invention. Apparently, thedescribed embodiments are merely a part rather than all of theembodiments of the present invention. All other embodiments obtained bypersons of ordinary skill in the art based on the embodiments of thepresent invention without creative efforts shall fall within theprotection scope of the present invention.

A rate group (Rate Group) in the present invention is used to combineone or more services, which have same costs or rating types, for ease ofrating by a charging system. A concept of the rate group in the presentinvention is different from that of a conventional rate. The rate refersto a unit price specified for each type of charging units. The rategroup may be used as a basis for the charging system to select a rate.Therefore, a change of the rate group may lead to a change of the rate,whereas the change of the rate has no impact on the rate group.

Refer to FIG. 1, which is a schematic flowchart of a method forprocessing a rate group according to an embodiment of the presentinvention. An execution subject of the method may be a gateway device.The following steps are mainly included:

S101

A gateway device determines whether a rate group of a service datastream changes.

In the embodiment of the present invention, the gateway device refers toa gateway at a network layer, and includes a gateway general packetradio service support node (GateWay General Packet Radio Service SupportNode, GGSN), a packet data network gateway (Packet Data Network Gateway,P-GW), a Wireless Application Protocol (Wireless Application Protocol,WAP) gateway, and so on. One of points that these gateway devices havein common is that a policy and charging enforcement function (Policy andCharging Execution Function, PCEF) may be included therein. A PCRFentity is a policy decision entity, and may exist separately or mayexist by being incorporated into another entity.

In the method for processing the rate group of the present invention,the gateway device may determine, as the following embodiments, whetherthe rate group of the service data stream changes:

Embodiment 1

The gateway device parses a service packet of the service data streamaccording to a service identification rule, and re-determines a rategroup according to a parsed result and rate group configuration of thegateway device, and if the re-determined rate group is different from acurrent rate group, determines that the rate group of the service datastream changes. That is to say, the gateway device is configured with adeep packet inspection (Deep Packet Inspection, DPI) identificationrule, parses information of a service stream according to the DPIidentification rule configured in the gateway device, and changes acharging control policy according to a parsed result, where the chargingcontrol policy includes a change of the rate group. Specificallyspeaking, the gateway device parses the service packet of the servicedata stream according to the DPI identification rule configured in thegateway device to acquire application-layer information of the servicedata stream, for example, what is obtained through parsing is a uniformresource locator (Uniform Resource Locator, URL) of the service datastream, which protocol the data stream is adopted, which application theservice data stream belongs to, and what type the application is (forexample, a streaming medium), and so on. After the result is obtainedthrough parsing, a rate group is re-determined according to the rategroup configuration (for example, a matching relationship between a rategroup and a service data stream) of the gateway device. If there-determined rate group is different from the current rate group, it isdetermined that the rate group changes and the gateway device triggers acharging procedure for the change of the rate group. It should be notedthat, in this embodiment, the current rate group is an effective rategroup currently allocated in the gateway device to the service datastream, and may be delivered previously by the PCRF to the gatewaydevice or may be in a static policy configured in the gateway device.

Embodiment 2

The gateway device receives an identification rule and a correspondingcharging control policy that are delivered by the policy and chargingrules function PCRF entity, where the charging control policy includes arate group; and then, the gateway device parses a service packet of theservice data stream according to the identification rule delivered bythe PCRF entity, matches, according to a parsed result, the rate groupdelivered by the PCRF entity to re-determine a rate group, and if there-determined rate group is different from a current rate group,determines that the rate group of the service data stream changes. Thatis to say, a PCRF in a home domain delivers a DPI identification ruleand a corresponding charging control policy to the gateway device, andthe gateway device parses information of a service stream according tothe delivered DPI identification rule and executes the charging controlpolicy according to the parsed result, where the charging control policyincludes a change of the rate group. In this embodiment, the DPIidentification rule that the PCRF in the home domain delivers to thegateway device is based on the following mechanism: The PCRF determines,according configuration of an operator or subscription data of asubscriber, that it is necessary to perform DPI; then, for each gatewaydevice, a list of locations of corresponding DPI modules is configuredin the PCRF to successfully download a DPI identification rule,

TABLE 1 GGSN IP DPI Type DPI IP/Port List of rules or list ofidentifiers supported by a DPI module

as shown in Table 1 (a GGSN in the GPRS is taken as an example) above,where the DPI Type indicates whether a DPI module is built into or outof the gateway device (for example, a GGSN); the PCRF determines, byquerying the list, a DPI module corresponding to the gateway device, soas to know whether the gateway device has a DPI capability, and if yes,delivers the DPI identification rule to the gateway device; afterreceiving the DPI identification rule delivered by the PCRF, the gatewaydevice parses the service packet of the service data stream according tothe DPI identification rule to acquire application-layer information ofthe service data stream, for example, what is obtained through parsingis a URL of the service data stream, which protocol adopted, whichapplication the service data stream belongs to, what type theapplication is (for example, a streaming medium), and so on, and afterthe result is obtained through parsing, re-determines a rate groupaccording to the rate group included in the charging control policydelivered by the PCRF; and if the re-determined rate group is differentfrom an original rate group, it is determined that the rate groupchanges, and the gateway device triggers a charging procedure for thechange of the rate group. Similar to the preceding Embodiment 1, in thisembodiment, the current rate group is an effective rate group currentlyallocated in the gateway device to the service data stream, and may bedelivered previously by the PCRF to the gateway device or may be one ina static policy configured in the gateway device.

Embodiment 3

The gateway device receives an identification rule identifier and acorresponding charging control policy that are delivered by the policyand charging rules function PCRF entity. In this embodiment, theidentification rule identifier is used to identify an identificationrule or a group of identification rules and may correspond to one ormore applications, and the charging control policy includes a rategroup. The gateway device matches, by using the identification ruleidentifier delivered by the PCRF entity an identification ruleconfigured in the gateway device, and parses a service packet of theservice data stream according to the matched identification rule, thenmatches the rate group delivered by the PCRF entity according to aparsed result to re-determine a rate group, and if the re-determinedrate group is different from a current rate group, determines that therate group of the service data stream changes. That is to say, a DPIidentification rule is configured in the gateway device, a DPIidentification rule identifier is allocated to the configured DPIidentification rule, a PCRF in a home domain delivers the DPIidentification rule identifier and a corresponding charging controlpolicy, and the gateway device matches, according to the delivered DPIidentification rule identifier, the DPI identification rule configuredin the gateway device, thereby parsing information of the service datastream by using the DPI identification rule and executing the chargingcontrol policy according a parsed result, where the charging controlpolicies include the change of the rate group. In this embodiment, theDPI identification rule configured in the gateway device is based on thefollowing mechanism: For each gateway device, a list of locations ofcorresponding DPI modules (as specifically shown in Table 1 of thepreceding Embodiment 2) is configured in the PCRF to successfullydownload the DPI identification rule; the gateway device executes theDPI identification rule to parse the service packet of the service datastream, so as to acquire application-layer information of the servicedata stream, for example, what is obtained through parsing is a URL ofthe service data stream, which protocol adopted, which application theservice data stream belongs to, what type the application is (forexample, a streaming medium), and so on; after a result is obtainedthrough parsing, a rate group is re-determined according to the rategroup included in the charging control policy delivered by the PCRF; andif the re-determined rate group is different from an original rategroup, it is determined that the rate group changes, and the gatewaydevice triggers a charging procedure for the change of the rate group.Similar to the preceding Embodiment 1 or 2, in this embodiment, thecurrent rate group is an effective rate group currently allocated in thegateway device to the service data stream, and may be deliveredpreviously by the PCRF to the gateway device or may be one in a staticpolicy configured in the gateway device. It should be noted that, inthis embodiment, the DPI identification rule identified by the DPIidentification rule identifier may be a DPI identification rule of adifferent granularity for identifying, for example, a certain URL, acertain type of URLs, a certain type of application protocols, a certainspecific application or a certain type of applications (for example, atype of peer-to-peer P2P download).

Embodiment 4

The gateway device receives a charging control policy update commanddelivered by the policy and charging rules function PCRF entity, wherethe charging control policy update command includes a rate group, and ifthe rate group included in the charging control policy update command isdifferent from a current rate group, determines that the rate group ofthe service data stream changes. That is to say, according to the ruleof the PCRF, information from an application layer, or a result obtainedfrom DPI performed by a DPI network element, the PCRF remakes a policydecision for the service data stream, decides a new charging controlpolicy, delivers and installs the charging control policy into thegateway device, where the charging control policy includes a new rategroup; the gateway device receives a policy and charging control rule(PCC Rule) delivered by a PCRF in a home domain and updates an existingPCC rule, where the rate group is updated in the new PCC rule; and thegateway device triggers a charging procedure for the change of the rategroup.

S102

If the rate group of the service data stream changes, the gateway devicereports charging data to the charging system, so that the chargingsystem performs charging according to the charging data.

It should be noted that, in the embodiment of the present invention, therate group has a priority attribute, that is, rate groups may have adifferent priority, so that the charging system is capable ofdetermining an appropriate rate group for service usage informationaccording to the priority of the rate group and performing chargingaccording to the determined rate group.

After detecting the change of the rate group, the gateway devicedisables a counter of the service data stream to stop counting theservice usage information (the service usage information corresponds tothe original rate group, and the original rate group in the presentinvention is the current rate group corresponding to the counted serviceusage information), and reports the charging data to the chargingsystem. The charging data includes the service usage information (suchas, data traffic or duration of an Internet subscriber) counted by thecounter of the service data stream, a reporting reason for reporting thecharging data, and so on. A value of the reporting reason (for onlinecharging, it is Reporting-Reason AVP; and for offline charging, it isChange-Condition AVP) carried in the reported charging data, isRATING_GROUP_CHANGE, indicating that reporting the charging data isbecause the rate group of the service data stream changes. In theembodiment of the present invention, the change of the rate group isused as a chargeable event (chargeable event).

In the embodiment of the present invention, if the charging system is anoffline charging system, the gateway device reports the charging data tothe charging system as follows: The gateway device reports the serviceusage information to a charging data function module, so that thecharging data function module encapsulates the service usage informationinto a charging data record (Charging Data Record, CDR), or the gatewaydevice encapsulates the service usage information and reports the CDRobtained after the encapsulation to the charging system. After thegateway device reports the charging data to the offline charging system,the gateway device enables a new counter to re-record usage informationof the service data stream and reports the usage information to theoffline charging system when a condition for reporting is met. Thecondition for reporting includes reporting at a rate change time point,and so on, where the rate change time point is configured in thegateway.

In the embodiment of the present invention, if the charging system is anonline charging system, that the gateway device reports the chargingdata to the charging system includes: the gateway device reportsauthorized usage information of the original rate group, to the onlinecharging system. Specifically, the authorized usage information of theoriginal rate group is reported by using a Used-Service-Unit parametercarried in a Diameter Credit Control Request command. If the servicedata stream still requires charging after the rate group of the servicedata stream changes, the gateway device applies, based on the rate groupincluded in the charging control policy update command or there-determined rate group, to the online charging system for creditauthorization after the gateway device reports the charging data to theonline charging system. Specifically, the credit authorized applicationis sent by using a Requested-Service-Unit parameter carried in theDiameter Credit Control Request command. The gateway device receives thecredit authorization granted, based on the rate group included in thecharging control policy update command or the re-determined rate group,by the online charging system, enables a new counter to re-record usageinformation of the service data stream, and reports the usageinformation to the online charging system when a condition for reportingis met. The condition for reporting may include: service start, serviceend, exhaustion of authorized credit quota, expiration of authorizedcredit quota, credit update required by the online charging system,re-authorization delivered by the online charging system, and so on.

After receiving the charging data reported by the gateway device, thecharging system re-determines a rate of the service data streamaccording to the reporting reason and the original rate group, andperforms fee deduction according to the re-determined rate. Thefollowing embodiment will give a detailed description.

It can be seen from the preceding embodiment of the present inventionthat, a gateway device can determine whether a rate group of a servicedata stream changes, and when the rate group of the service data streamchanges, report charging data including a re-determined rate group to acharging system, so that the charging system performs charging accordingto the charging data. Therefore, compared with the prior art, the methodfor processing a rate group that is provided by the embodiment of thepresent invention can enable the charging system to know a change of therate group, thereby reducing impacts of the change of the rate group oncharging accuracy and making the charging more accurate.

Refer to FIG. 2, which is a schematic flowchart of a method for chargingfor a data service according to an embodiment of the present invention.An execution subject of the method may be a charging system (includingan online charging system and an offline charging system). The followingsteps are mainly included:

S201

A charging system receives charging data reported by a gateway devicewhen the gateway device determines that a rate group of a service datastream changes.

In this embodiment, the charging data includes service usage informationand a reporting reason for reporting the charging data, where thereporting reason indicates that the gateway device reports the chargingdata because the rate group of the service data stream changes.

S202

The charging system re-determines a rate of the service data streamaccording to the reporting reason and an original rate group.

In the method for charging for a data service that is provided by thepresent invention, the charging system may re-determine, as thefollowing embodiments, the rate of the service data stream according tothe reporting reason and the original rate group:

Embodiment 1

If the original rate group is a high-priority rate group, the rate ofthe service data stream is re-determined by using the original rategroup. It should be noted that, in the embodiment of the presentinvention, the so-called high-priority rate group refers to a rate grouppreferentially used by the charging system to determine a rate, and thenperform pricing and fee deduction on the reported service usageinformation, and so on.

Embodiment 2

If the original rate group is a low-priority rate group, the chargingsystem stores usage information of the service data stream, and whenreceiving a high-priority rate group, re-determines the rate of theservice data stream, or if the charging system does not receive ahigh-priority rate group before the service ends (for example, acharging session may end) or before a preset timeout setting isexceeded, re-determines the rate of the service data stream by using theoriginal rate group. It should be noted that, in the embodiment of thepresent invention, the low-priority rate group not only represents arate but also is used to express an indication, that is, indicating thatthe charging system preferentially uses another high-priority rate groupand uses the low-priority rate group only when no high-priority rategroup exists.

S203

The charging system performs fee deduction according to there-determined rate.

For example, if the charging system has not received a high-priorityrate group before the service ends or a preset timeout setting isexceeded, the rate of the service data stream is re-determined by usingthe original rate group and fee deduction is performed according to there-determined rate; that is, if the original rate group is alow-priority rate group corresponding to a rate of 0, fee deduction isnot performed on the service usage information corresponding to theservice data stream and the original rate group during this servicecharging, and if fee deduction has already been performed, a fee returnprocedure is enabled to return the deducted fee. Specifically, thecharging system stores the service usage information; after receiving anew high-priority rate group that may be used for the service datastream, uses the new rate group to perform rating and fee deduction, andif no new rate group is received before the service ends or before thepreset timeout setting is exceeded, uses the low-priority rate group toperform rating and fee deduction; and if a rate corresponding to thelow-priority rate group is 0, does not perform fee deduction on theservice usage information corresponding to the service data stream andthe rate group during this service charging, and if fee deduction hasalready been performed, enables a fee return procedure to return thededucted fee.

It can be seen from the method for charging for a data service shown inFIG. 2 that, a charging system may re-determine a rate of a service datastream according to a reporting reason for reporting charging data andan original rate group, where the charging data is reported by a gatewaydevice, and perform fee deduction according to the re-determined rate,and furthermore, flexibly indicate that the charging system selects, bydistinguishing between priorities of rate groups, a rate group with thehighest priority to perform charging. Therefore, the method for chargingfor a data service that is provided by the embodiment of the presentinvention reduces impacts of a change of a rate group on chargingaccuracy and making the charging more accurate.

The following further describes the method for charging for a dataservice that is provided by the present invention with reference to theembodiments in FIG. 1 and FIG. 2. Refer to FIG. 3, which is a schematicflowchart of interaction of devices in a method for charging for a dataservice according to an embodiment of the present invention. Thefollowing steps are mainly included:

S301

A gateway device determines whether a rate group of a service datastream changes.

As previously mentioned, the gateway device may determine, based on aresult obtained by parsing a service packet of the service data streamaccording to a service identification rule, whether the rate group ofthe service data stream changes; determine, based on a result obtainedby parsing a service packet of the service data stream according to anidentification rule delivered by a PCRF entity, whether the rate groupof the service data stream changes; determine, based on a resultobtained by parsing a service packet of the service data streamaccording to an identification rule matching the identification ruleidentifier delivered by the PCRF entity, whether the rate group of theservice data stream changes; or determine, according to whether the rategroup is updated in a charging control policy update command deliveredby the PCRF entity, whether the rate group of the service data streamchanges.

S302

If the rate group of the service data stream changes, the gateway devicereports charging data to a charging system.

After detecting that the rate group changes, the gateway device disablesa counter of the service data stream (the counter corresponds to anoriginal rate group) and reports the charging data to the chargingsystem. The charging data includes service usage information (such as,data traffic or duration of an Internet subscriber) counted by thecounter of the service data stream, a reporting reason for reporting thecharging data, and so on.

If the charging system is an online charging system, the gateway devicereports authorized usage information of the original rate group to theonline charging system (step S303). Furthermore, if the service datastream still requires charging after the rate group of the service datastream changes, the gateway device further applies, based on a rategroup included in a charging control policy update command or are-determined rate group, to the online charging system for creditauthorization after the gateway device reports the authorized usageinformation of the original rate group to the online charging system(step S304).

S305

The charging system receives the charging data reported by the gatewaydevice when the gateway device determines that the rate group of theservice data stream changes.

S306

The charging system re-determines a rate of the service data streamaccording to a reporting reason and the original rate group.

For example, according to a priority of the rate group, if the originalrate group is a high-priority rate group, the charging system may usethe original rate group to re-determine the rate of the service datastream; or if the original rate group is a low-priority rate group, thecharging system stores usage information of the service data stream, andwhen receiving a high-priority rate group, re-determines the rate of theservice data stream, or when the charging system does not receive ahigh-priority rate group, re-determines the rate of the service datastream by using the original rate group.

To clearly describe a procedure for interaction of devices in the methodfor charging for a data service shown in FIG. 3, the following takesInternet access (online charging is taken as an example) as an examplefor description. Refer to FIG. 4, and it is assumed that an operator maycarry out an ordinary rate for ordinary network use (such as, newsbrowse, information query, and forum discussion) and carry out acomparatively high rate for peer-to-peer (Peer to Peer, P2P) network useincreasing network pressure. This embodiment takes ordinary network useand P2P applications as an example for description, where a rate group1001 has a same priority as a rate group 1003. The example shown in FIG.4 mainly includes the following steps:

S401

When a subscriber accesses the Internet, a user equipment requests agateway device (including a PCEF entity) to establish a data bearerchannel for data transmission.

S402

The gateway device reports information related to a service stream to aPCRF and requests a policy, where the policy includes QoS, gating, andcharging control policies, and so on.

S403

According to information related to a service stream that is provided bygateway device and in combination with configured information of thePCRF, subscription information from the outside, subscriber informationor account information of the subscriber, and so on, the PCRF makes apolicy decision, allocates QoS to the subscriber for Internet access,and determines the rate group 1001.

S404

The PCRF delivers the policy to the gateway device, where the policycarries the QoS allocated to the subscriber for Internet access and therate group 1001.

S405

The gateway device requests, based on the rate group 1001 delivered bythe PCRF, credit authorization from an online charging system.

S406

The online charging system determines a rate according to a subscribertype, a package type, a reward policy, rate group information, and soon, performs the credit authorization according to the rate and theaccount information of the subscriber, and returns corresponding creditauthorization to the gateway device.

S407

The subscriber uses a service, and the gateway device detects a usagecondition of the credit authorization.

S408

A DPI module (which may be built into the gateway device, or built outas an independent DPI network element) detects that the subscriber usesa P2P request and reports a result of the detection to the PCRF.

S409

The PCRF remakes a policy decision based on a result of the detectionand allocates the rate group 1003 for the P2P.

S410

The PCRF delivers the new rate group 1003 to the gateway device.

S411

The gateway device detects that the rate group changes, triggers acharging reporting action, and stops using the credit authorizationapplied by the rate group 1001 for the service.

S412

Apply for credit authorization again based on the rate group 1003.

S413

After receiving service usage information reported by the gatewaydevice, the online charging system decides, according to priorities ofthe rate group 1001 and the rate group 1003, to perform fee deduction onthe reported service usage information by taking the rate group 1001 asa basis, and performs the credit authorization according to a new creditapplication.

Although according to an existing PCC mechanism, the PCRF can deliverthe charging control policy, a change of a charging entity during acharging process (this mainly refers to a change from network-layercharging to application-layer charging) and charging data generatedbefore the change cannot be processed accurately, so that the chargingcontrol policy delivered by the PCRF may fail to cover all conditions,which may lead to overcharging or undercharging that is difficult tofind out, and in turn leads to a more serious problem. Therefore, it isimpossible to implement that the PCRF takes control of application-layercharging and network-layer charging for a data service, so that it isimpossible to implement, before the charging begins, determining thatcertain services are only charged at the application layer. In addition,an existing mode for charging for a data service is complex and has manycharging triggering points at an application layer, a network layer, andso on. For certain services (for example, an IMS call), charging needsto be triggered only at the application layer, certain services (forexample, ordinary new browse) only require triggering charging at thenetwork layer, certain services (for example, download of certaincontent) are charged at both the application layer and the network layerbut at different rates and so on. To avoid repetitive charging, currentcharging processing is processing during charging or processing aftercharging. The processing during charging mainly includes online chargingcorrelation. After receiving charging requests reported by differentnetwork elements, the online charging system performs chargingcorrelation to avoid repetitive charging. In this process, in oneaspect, the processing in the online charging system is complex, forexample, transmission of a charging correlation identifier between thenetwork layer and the application layer is hysteretic, and this makesthe online charging system fail to perform correlation in an initialcharging request but to attempt performing correlation after everycharging request comes subsequently, thereby making the processing ofthe online charging system complex and affecting processing performance;in another aspect, it is difficult to determine through correlationwhich network element is more reasonable for serving as a chargingnetwork element because no service information is available in theonline charging system. The processing after charging requirescorrelation of a large amount of charging information. A large number ofcharging data records pose a very great burden on the processing, posesa very high requirement on a processing system, and has a great impacton timeliness in billing.

To solve the preceding problems in the existing PCC mechanism, anembodiment of the present invention provides another method for chargingfor a data service. Refer to FIG. 5, which is a schematic flowchart of amethod for processing a data service according to another embodiment ofthe present invention. An execution subject of the method may be apolicy and charging rules function PCRF entity. The following steps aremainly included:

S501

The policy and charging rules function PCRF entity determines, accordingto an identification result of identifying a service, whether it isnecessary to charge at a network layer and to deliver a charging controlpolicy to a gateway device after generating the charging control policy,so that the gateway device executes the charging control policy.

In this embodiment, a charging rule may be configured in advance both ina PCRF in a home domain and in a charging system, where the chargingrule configured in the PCRF includes: a service, whether to charge on aPCEF, and a rate group. The service may be indicated by using anidentifier and may also be indicated by using an IP filtering ruleidentifier.

When the policy and charging rules function PCRF entity receives apolicy request message reported by the gateway device, the policyrequest message may include a service stream filtering rule, the PCRFentity identifies a service according to information reported by thegateway device. Specifically, if the policy request message carries theservice data stream filtering rule, the PCRF entity may match theidentification rule configured in the PCRF with the service streamfiltering rule reported by the gateway device. If the matching succeeds,the service is successfully identified, a charging rule corresponding tothe successfully identified service is queried from preconfiguredcharging rules according to an identification result, and it isdetermined, according to a query result, whether it is necessary tocharge at the network layer, and if yes, a rate group is furtherdetermined.

If it is determined, according to the query result, that it is necessaryto charge at the network layer, the PCRF generates the charging controlpolicy, where the charging control policy includes a rate groupcorresponding to the service. Optionally, the charging control policygenerated after it is determined, according to the query result, tocharge at the network layer further includes a charging mode forcharging for the service, such as, online charging or offline charging.If no charging mode is included, a default charging mode of the gatewaydevice is used.

If it is determined, according to the query result, that it isunnecessary to charge at the network layer, the PCRF generates thecharging control policy including an indication for not charging for theservice, for example, indicating not to perform online charging and notto perform offline charging.

The preceding embodiment is a case where the PCRF entity cansuccessfully match identification rule configured in the PCRF with theservice stream filtering rule reported by the gateway device. If thematching fails, the PCRF entity confirms that the service is anunidentifiable service, and the PCRF entity is not sure whether it isnecessary to charge the unidentifiable service at the network layer. Inthis case, the PCRF entity may still generate a charging control policyfor the unidentifiable service, which includes that: The PCRF entitygenerates a charging control policy including a low-priority rate groupand/or a general filtering rule for the unidentifiable service, so as tosubsequently identify the service, change the rate group, and rechargefor a used data stream. Furthermore, when the PCRF entity determinesthat it is unnecessary to charge for the unidentifiable service at thenetwork layer, the charging control policy generated by the PCRF entityfor the unidentifiable service includes a low-priority rate group with arate of 0. Specifically, according to a service that a subscribersubscribes to, the PCRF entity may determine certain preset generalfiltering rules and determine a low-priority rate group. Thelow-priority rate group represents that the charging system needs toperform pricing and fee deduction on a service data stream by selectinganother related rate group with a higher priority and considers thelow-priority rate group (the low-priority rate group corresponds to apreset rate, and the preset rate may indicate a non-charging rate 0 oranother rate) only when no other rate group exists. The charging systemmay identify the low-priority rate group, and the PCRF generates thecharging control policy. The charging control policy includes thepreceding determined filtering rules and low-priority rate group, andoptionally, may further include the charging mode. If no charging modeis included, the default charging mode of the gateway is used.

After the policy and charging rules function PCRF entity generates thecharging control policy and delivers the charging control policy to thegateway device, the gateway device executes the charging control policy.When the gateway executes the charging control policy, two cases areincluded, that is:

Case 1

The gateway device acquires the charging control policy and knows,according to the charging control policy, a charging indication and arate group. If the charging indication clearly requires online chargingor offline charging to be performed on a specific service data stream,the gateway device performs charging processing according to the rategroup. For online charging, firstly credit authorization is reserved inan online charging system, and service usage information is collectedbased on the authorization. For offline charging, a charging data recordis enabled to record the service usage information. The rate group heremay be an accurate rate group determined after a service is successfullyidentified and may also be a low-priority rate group when the servicecannot be identified.

Case 2

The gateway device acquires the charging control policy and knows,according to the charging control policy, a charging indication. If thecharging indication is that charging is not performed at the networklayer, the gateway device does not trigger online or offline chargingbut allocates bandwidth and QoS to the service data stream and theservice is released. Definitely, the gateway device may still generate acharging data record not used for charging, where the charging datarecord is used for reconciliation and other analysis purposes.

Furthermore, the gateway device reports collected service usageinformation to the charging system. That is to say, if it is necessaryto charge at the network layer, the gateway device collects the serviceusage information for the service, and when a condition for a chargingreport is met, reports the collected service usage information. In thisembodiment, the condition for reporting includes a change of the rategroup, where the change results from a policy of the gateway deviceitself. In this case, a reporting reason is carried in a reportedmessage indicates that an occurrence of a reporting action results fromthe change of the rate group.

The charging system receives charging data reported by the gatewaydevice, where the charging data includes the service usage informationand the reporting reason for reporting the charging data. If thereporting reason is the change of the rate group, the charging systemre-determines, a rate of the service data stream according to thereporting reason and an original rate group and performs fee deduction,which includes:

Embodiment 1

If the original rate group is a high-priority rate group, the rate ofthe service data stream is re-determined by using the original group. Itshould be noted that, in the embodiment of the present invention, theso-called high-priority rate group refers to a rate group preferentiallyused by the charging system to determine a rate, and then performpricing and fee deduction on the reported service usage information, andso on.

Embodiment 2

If the original rate group is a low-priority rate group, the chargingsystem stores usage information of the service data stream, and whenreceiving a high-priority rate group, re-determines the rate of theservice data stream, or when the charging system does not receive ahigh-priority rate group, re-determines the rate of the service datastream by using the original rate group. It should be noted that, in theembodiment of the present invention, the low-priority rate group notonly represents a rate but also is used to express an indication, thatis, indicating that the charging system preferentially uses anotherhigh-priority rate group and uses the low-priority rate group only whenno high-priority rate group exists.

S502

If the PCRF confirms that it is necessary to change the charging controlpolicy, the PCRF regenerates a charging control policy and delivers thecharging control policy to the gateway device.

Confirming, by the PCRF, that it is necessary to change the chargingcontrol policy, thereby regenerating a charging control policy anddelivering the charging control policy to the gateway device includesthe following embodiments:

Embodiment 1

The PCRF correlates an application layer and the network layer of theunidentifiable service according to application-layer information of theunidentifiable service and performs identification on the unidentifiableservice. Specifically, when the service data stream arrives at theapplication layer, an application-layer network element may report theapplication-layer information of the service to the PCRF, such as, aservice identifier and a subscriber identity, and the PCRF correlatesthe application layer and the network layer of the service based on theapplication-layer information and identifies the unidentifiable servicein step S501. If the PCRF identifies the unidentifiable service, it isdetermined whether it is necessary to adjust a charging mode and/or arate group for the identified service. If it is determined that it isnecessary to adjust the charging mode and/or the rate group for theidentified service, a charging control policy is regenerated. Theregenerated charging control policy includes a new charging mode and/ora high-priority rate group allocated to the identified service. The PCRFentity delivers the regenerated charging control policy to the gatewaydevice.

Embodiment 2

The PCRF performs identification on the unidentifiable service accordingto a received deep packet inspection DPI result, where the DPI result isreported to the PCRF by the gateway device after the gateway deviceperforms, according to a DPI identification rule or a DPI identificationrule identifier delivered by the PCRF, identification on theunidentifiable service. Specifically, the PCRF delivers the DPIidentification rule to the gateway device based on the followingmechanism: The PCRF determines that it is necessary to perform DPIaccording configuration of an operator or subscription data of asubscriber; for each gateway device, a list of locations ofcorresponding DPI modules is configured in the PCRF to successfullydownload a DPI identification rule, as shown in Table 2 below (a GGSN inthe GPRS is taken as an example), where DPI Type points out whether aDPI module is built into or built out of the gateway device (forexample, a GGSN);

TABLE 2 GGSN IP DPI Type DPI IP/Port List of rules or list ofidentifiers supported by a DPI module

the PCRF determines, by querying this list, a DPI module correspondingto the gateway device, so as to know whether the gateway device has aDPI capability, and if yes, delivers the DPI identification rule to thegateway device; after receiving the DPI identification rule delivered bythe PCRF or a DPI identification rule identifier allocated to the DPIidentification rule, the gateway device parses, according to the DPIidentification rule or the DPI identification rule matching the DPIidentification rule identifier, a service packet of the service datastream to acquire the application-layer information of the service datastream, for example, what is obtained through parsing is a URL of theservice data stream, which protocol adopted, which application theservice data stream belongs to, what type of application is (forexample, a streaming medium), and so on, obtains a DPI result, andreports the DPI result to the PCRF entity. If the PCRF identifies theunidentifiable service, it is determined whether it is necessary toadjust a charging mode and/or a rate group for the identified service.If it is determined that it is necessary to adjust the charging modeand/or the rate group for the identified service, a charging controlpolicy is regenerated. The regenerated charging control policy includesa new charging mode and/or a high-priority rate group allocated to theidentified service.

Embodiment 3

The PCRF entity delivers an identification rule identifier to a deeppacket inspection DPI network element, so that the DPI network elementmatches, according to the identification rule identifier, anidentification rule or a group of identification rules preconfigured inthe DPI network element, detects the packets of the service data streamaccording to the matched identification rule, and reports a result ofthe detection to the PCRF entity. The PCRF entity determines, accordingto the result of the detection, whether it is necessary to change thecharging control policy. For example, the PCRF entity may deliver inadvance the DPI identification rule or the DPI identification ruleidentifier and a corresponding charging control policy (including a newcharging mode and rate group) to the gateway device according to thepolicy request message reported by the gateway device. It should benoted that, in this embodiment, the DPI identification rule identifieris used to identify a DPI identification rule or a group of DPIidentification rules and may correspond to one or more applications. Theidentification rule is preconfigured in the DPI module. The DPIidentification rule may be of a different granularity for identifying,for example, a certain URL, a certain type of URLs, a certain type ofapplication protocols, a specific application or a certain type ofapplications (for example, a type of peer-to-peer download). A specificdelivering method is described in Embodiment 2 of step S502. If thegateway device detects that the service data stream matches the DPIidentification rule delivered in advance or the identification rulecorresponding to the DPI identification rule identifier, and the DPIidentification rule or the DPI identification rule identifier deliveredin advance has a corresponding charging control policy, the gatewaydevice executes the charging control policy.

Embodiment 4

If that the PCRF confirms that it is necessary to change the chargingcontrol policy is that the PCRF confirms according to other inputs ortriggering conditions, that it is necessary to change the rate group ofthe service data stream, the charging control policy regenerated anddelivered to the gateway device includes a regenerated rate group, sothat the gateway device triggers reporting of the charging data to thecharging system, where the charging data includes the service usageinformation and a reporting reason for reporting the charging data andthe reporting reason indicates a change of the rate group.

The gateway device performs charging processing according to thecharging control policy regenerated by or the charging control policydelivered in advance by the PCRF entity, where the regenerated chargingcontrol policy includes an adjustment in the charging mode and/or anadjustment in the rate group, which includes that: if the adjustment inthe charging mode is a change from non-charging to charging, the gatewaydevice records the service usage information or reports the serviceusage information to the online charging system; if the adjustment inthe charging mode is a change from charging to non-charging, the gatewaydevice reports service usage information and a reporting reason carriesa Final indication to the charging system; and if the regeneratedcharging control policy includes the adjustment in the rate group, thegateway device reports the charging data to the charging system, so thatthe charging system performs charging according to the charging data,where the charging data includes the service usage information, thereporting reason for reporting the charging data, and a rate groupre-determined by the gateway device. Specifically:

1) If the regenerated charging control policy includes the adjustment inthe charging mode, an original charging method is non-charging, and acharging mode after the adjustment is changed into online charging oroffline charging, the gateway device performs charging processingaccording to the rate group. If the charging mode after the adjustmentis online charging, firstly credit authorization is reserved in theonline charging system, and the service usage information is collectedbased on the authorization. If the charging mode after the adjustment isoffline charging, a charging data record is enabled to record theservice usage information. If the original charging method is onlinecharging or offline charging, the charging mode after the adjustment ischanged into non-charging, the gateway device disables a current recordand reports the service usage information to the charging system, wherethe reporting reason needs to carry the Final indication.

2) If the regenerated charging control policy includes the adjustment inthe rate group, the gateway device disables a counter of the servicedata stream (the counter corresponds to the original rate group) afterdetecting that the rate group changes, and reports the service usageinformation counted by the counter of the service data stream andcharging data of other service information to the charging system, wherethe reported charging data carries the reporting reason, and thereporting reason indicates that the reporting is because of the changeof the rate group of the service data stream.

For the charging system in this case, if the reporting reason includedin the charging data received by the charging system and reported by thegateway device is the change of the rate group, a rate is determinedaccording to the reporting reason and the original rate group incombination with other parameters, and fee deduction is performed, whichincludes:

Embodiment 1

If the original rate group is a high-priority rate group, t the rate ofthe service data stream is re-determined by using the original group. Itshould be noted that, in the embodiment of the present invention, theso-called high-priority rate group refers to a rate group preferentiallyused by the charging system to determine a rate, and then performpricing and fee deduction on the reported service usage information, andso on.

Embodiment 2

If the original rate group is a low-priority rate group, the chargingsystem stores the usage information of the service data stream, and whenreceiving a high-priority rate group, re-determines the rate of theservice data stream, or when the charging system does not receive ahigh-priority rate group, re-determines the rate of the service datastream by using the original rate group. It should be noted that, in theembodiment of the present invention, the low-priority rate group notonly represents a rate but also is used to express an indication, thatis, indicating that the charging system preferentially uses anotherhigh-priority rate group and uses the low-priority rate group only whenno high-priority rate group exists.

If the reporting reason included in the charging data received by thecharging system and reported by the gateway device is a Final report,the rate is determined according to the reporting reason and the rategroup in combination with other parameters, and fee deduction isperformed, which includes that:

If the rate group is a high-priority rate group, where the high priorityhere means that the charging system preferentially uses this rate groupto determine the rate, the original rate group is used to price andperform fee deduction on the reported service usage information, and acharging session is closed.

If the rate group is a low-priority rate group, where the low priorityhere means that this rate group not only represents a rate but also isused to express an indication, the charging system preferentially usesanother high-priority rate group and uses the low-priority rate grouponly when no high-priority rate group exists, and if the charging systemdoes not receive a new rate group for the service data stream, uses thelow-priority rate group to perform rating and fee deduction, if a ratecorresponding to the low-priority rate group is 0, does not perform feededuction on the service usage information corresponding to the servicedata stream and the rate group during this service charging, and if feededuction has already been performed, enables a fee return procedure toreturn the deducted fee and closes a charging session.

It can be seen from the preceding example in FIG. 5 that, a policy andcharging rules function PCRF entity can determine, according to anidentification result of identifying a service, whether it is necessaryto charge at a network layer and to deliver a charging control policy toa gateway device after generating the charging control policy; when aservice data stream arrives at an application layer, and the PCRFconfirms that it is necessary to change a charging control policy, acharging control policy is regenerated and delivered to the gatewaydevice; furthermore, charging for a data service is implemented based onPCRF configuration and a rate group priority mechanism, this may controlcertain services to be charged only at the network layer and certainservices to be charged at the application layer, and control certainservices to be charged only at the application layer, certain servicesto be charged only at the network layer, and certain services to becharged at both the application layer and the network layer but atdifferent rates and so on. Therefore, compared with an existing PCCmechanism, avoiding a collaboration problem between application-layercharging and network-layer charging from a source avoids repetitivecharging, and this, compared with correlation performed by the chargingsystem to avoid repetition between application-layer charging andnetwork-layer charging, reduces difficulties and pressure in chargingcorrelation performed by the charging system and is more effectiveespecially with regard to online charging.

Refer to FIG. 6, which is a schematic flowchart of a method for chargingfor a data service according to another embodiment of the presentinvention. An execution subject of the method may be a gateway device.The following steps are mainly included:

S601

A gateway device acquires a charging control policy delivered by apolicy and charging rules function PCRF entity.

The following two specific cases are included:

Case 1

The gateway device acquires the charging control policy and knows,according to the charging control policy, a charging indication and arate group. If the charging indication clearly requires online chargingor offline charging to be performed on a specific service data stream,the gateway device performs charging processing according to the rategroup. For online charging, firstly credit authorization is reserved inan online charging system, and service usage information is collectedbased on the authorization. For offline charging, a charging data recordis enabled to record the service usage information. The rate group heremay be an accurate rate group determined after a service is successfullyidentified and may also be a low-priority rate group when the servicecannot be identified.

Case 2

The gateway device acquires the charging control policy and knows,according to the charging control policy, a charging indication. If thecharging indication is that charging is not performed at a networklayer, the gateway device does not trigger online or offline chargingbut allocates bandwidth and QoS to a service data stream and the serviceis released. Definitely, the gateway device may still generate acharging data record not used for charging, where the charging datarecord is used for reconciliation and other analysis purposes.

S602

If the charging control policy indicates that it is necessary to chargeat a network layer, the gateway device records usage information of aservice and reports charging data to a charging system, where thecharging data includes counted service usage information, such asduration or traffic.

That is to say, if it is necessary to charge at the network layer, thegateway device collects the service usage information for the service,and when a condition for a charging report is met, reports the collectedservice usage information. In this embodiment, the condition forreporting includes a change of the rate group, where the change resultsfrom a policy of the gateway device itself. In this case, a reportingreason is carried in a reported message indicates that an occurrence ofa reporting action results from the change of the rate group.

S603

If the PCRF entity delivers a regenerated charging control policy, thegateway device performs charging processing according to the regeneratedcharging control policy, where the regenerated charging control policyincludes an adjustment in a charging mode and/or an adjustment in therate group.

When a service stream arrives at an application layer, the PCRF entityregenerates the charging control policy according to service informationreported by an application-layer network element to the PCRF, or thePCRF entity regenerates the charging control policy according to adetection result of the service data stream and delivers the chargingcontrol policy to the gateway device, where the detection result isreported by a DPI module specified by the PCRF entity.

If the adjustment in the charging mode is a change from non-charging tocharging, the gateway device records the service usage information orreports the service usage information to the online charging system. Ifthe adjustment in the charging mode is a change from charging tonon-charging, the gateway device reports service usage information and areporting reason carries a Final indication to the charging system. Ifthe regenerated charging control policy includes the adjustment in therate group, the gateway device reports the charging data to the chargingsystem, so that the charging system performs charging according to thecharging data, where the charging data includes the service usageinformation, the reporting reason for reporting the charging data, and arate group re-determined by the gateway device.

The following further describes the method for charging for a dataservice that is provided by the present invention with reference to theembodiments of FIG. 5 and FIG. 6. Refer to FIG. 7, which is a schematicflowchart of interaction of devices in a method for charging for a dataservice according to an embodiment of the present invention. Thefollowing steps are mainly included:

S701

PCRF in a home domain and a charging system synchronously configure acharging rule.

The charging rule configured in the PCRF includes a service, whether tocharge on a PCEF, and a rate group. The service may be indicated byusing an identifier and may also be indicated by using an IP filteringrule identifier.

S702

A gateway device sends a policy request message to the policy andcharging rules function PCRF entity.

The policy request message may carry a service data stream filteringrule.

S703

The policy and charging rules function PCRF entity determines, accordingto an identification result of identifying a service, whether it isnecessary to charge at a network layer and to generate a chargingcontrol policy.

Specifically, the PCRF entity may match the identification ruleconfigured in the PCRF with the service stream filtering rule reportedby the gateway device. If the matching succeeds, the service issuccessfully identified, it is determined, according to theidentification result, whether it is necessary to charge at the networklayer, and if yes, a rate group is further determined. If it isdetermined, according to a query result, that it is necessary to chargeat the network layer, the PCRF generates the charging control policy,where the charging control policy includes a rate group corresponding tothe service. Optionally, the charging control policy generated after itis determined, according to the query result, to charge at the networklayer further includes a charging mode for charging for the service,such as, online charging or offline charging. If no charging mode isincluded, a default charging mode of the gateway device is used. If itis determined, according to the query result, that it is unnecessary tocharge at the network layer, determining, according to the query result,t the PCRF generates the charging control policy including an indicationfor not charging for the service, for example, indicating not to performonline charging and not to perform offline charging.

If the PCRF entity matches the identification rule configured in thePCRF with the service stream filtering rule reported by the gatewaydevice and they cannot be successfully matched, the PCRF entity confirmsthat the service is an unidentifiable service, and the PCRF entity isnot sure whether it is necessary to charge for the unidentifiableservice at the network layer. In this case, the PCRF entity may stillgenerate a charging control policy for the unidentifiable service, whichincludes that: The PCRF entity generates the charging control policyincluding a low-priority rate group and a general filtering rule for theunidentifiable service. Furthermore, when the PCRF entity determinesthat it is unnecessary to charge for the unidentifiable service at thenetwork layer, the PCRF entity generates a charging control policyincluding a low-priority rate group with a rate of 0 for theunidentifiable service. Specifically, according to a service that asubscriber subscribes to, the PCRF entity may determine certain presetgeneral filtering rules and determine a low-priority rate group. Thelow-priority rate group represents that the charging system needs toperform pricing and fee deduction on a service data stream by selectinganother related rate group with a higher priority and considers thelow-priority rate group (the low-priority rate group corresponds to apreset rate, and the preset rate may indicate a non-charging rate 0 oranother rate) only when no other rate group exists. The charging systemmay identify the low-priority rate group, and the PCRF generates thecharging control policy. The charging control policy includes thepreceding determined filtering rules and low-priority rate group, andoptionally, may further include the charging mode. If no charging modeis included, the default charging mode of the gateway is used.

S704

The policy and charging rules function PCRF delivers the generatedcharging control policy to the gateway device.

S705

The gateway device executes the charging control policy.

For online charging, firstly credit authorization is reserved in anonline charging system, and service usage information is collected basedon the authorization. For offline charging, a charging data record isenabled to record the service usage information.

S706

The gateway device reports charging data to the charging system.

That is to say, if it is necessary to charge at the network layer, thegateway device collects the service usage information for the service,and when a condition for a charging report is met, reports the collectedservice usage information. In this embodiment, the condition forreporting includes a change of the rate group, where the change resultsfrom a policy of the gateway device itself. In this case, a reportingreason is carried in a reported message indicates that an occurrence ofa reporting action results from the change of the rate group.

S707

The charging system processes the reported charging data.

If the reporting reason included in the charging data received by thecharging system and reported by the gateway device is the change of therate group, a rate is determined according to the reporting reason andan original rate group in combination with other parameters, and feededuction is performed, which includes that: If the original rate groupis a high-priority rate group, a rate of the service data stream isre-determined by using the original rate group; or if the original rategroup is a low-priority rate group, the charging system stores usageinformation of the service data stream, and when receiving ahigh-priority rate group, re-determines the rate of the service datastream, or if the charging system does not receive a high-priority rategroup, re-determines the rate of the service data stream by using theoriginal rate group.

S708

When the service data stream arrives at an application layer or a DPImodule specified by the PCRF entity reports a detection result of theservice data stream, and the PCRF entity confirms that it is necessaryto change the charging control policy, the PCRF entity regenerates acharging control policy.

S709

The PCRF entity delivers the regenerated charging control policy to thegateway device.

S710

The gateway device performs charging processing according to theregenerated charging control policy, which includes reporting thecharging data to the charging system (S711).

That is to say, if an adjustment in the charging mode is a change fromnon-charging to charging, the gateway device records the service usageinformation or reports the service usage information to the onlinecharging system. If the adjustment in the charging mode is a change fromcharging to non-charging, the gateway device reports service usageinformation and a reporting reason carries a Final indication to thecharging system. If the regenerated charging control policy includes theadjustment in the rate group, the gateway device reports the chargingdata to the charging system, so that the charging system performscharging according to the charging data, where the charging dataincludes the service usage information, the reporting reason forreporting the charging data, and a rate group re-determined by thegateway device.

S712

The charging system determines a rate according to the charging data andperforms fee deduction.

Specifically, if the reporting reason included in the charging datareceived by the charging system and reported by the gateway device isthe change of the rate group, the rate is determined according to thereporting reason and the original rate group in combination with otherparameters, and the fee deduction is performed, which includes:

Embodiment 1

If the original rate group is a high-priority rate group, the rate ofthe service data stream re-determined by using the original rate group.It should be noted that, in the embodiment of the present invention, theso-called high-priority rate group refers to a rate group preferentiallyused by the charging system to determine a rate, and then performpricing and fee deduction on the reported service usage information, andso on.

Embodiment 2

If the original rate group is a low-priority rate group, the chargingsystem stores the usage information of the service data stream, and whenreceiving a high-priority rate group, re-determines the rate of theservice data stream, or when the charging system does not receive ahigh-priority rate group, re-determines the rate of the service datastream by using the original rate group. It should be noted that, in theembodiment of the present invention, the low-priority rate group notonly represents a rate but also is used to express an indication, thatis, indicating that the charging system preferentially uses anotherhigh-priority rate group and uses the low-priority rate group only whenno high-priority rate group exists.

If the reporting reason included in the charging data received by thecharging system and reported by the gateway device is a Final report,the rate is determined according to the reporting reason and the rategroup in combination with other parameters, and fee deduction isperformed, which includes that:

If the rate group is a high-priority rate group, where the high priorityhere means that the charging system preferentially uses this rate groupto determine the rate, the original rate group is used to price andperform fee deduction on the reported service usage information, and acharging session is closed.

If the rate group is a low-priority rate group, where the low priorityhere means that this rate group not only represents a rate but also isused to express an indication, the charging system preferentially usesanother high-priority rate group and uses the low-priority rate grouponly when no high-priority rate group exists, and if the charging systemdoes not receive a new rate group for the service data stream, uses thelow-priority rate group to perform rating and fee deduction, if a ratecorresponding to the low-priority rate group is 0, does not perform feededuction on the service usage information corresponding to the servicedata stream and the rate group during this service charging, and if feededuction has already been performed, enables a fee return procedure toreturn the deducted fee and closes a charging session.

The following takes content download (online charging is taken as anexample) as an example for description, so as to describe, in a moreclearly way, a procedure of interaction of devices in the method forcharging for a data service as shown in FIG. 7. Refer to FIG. 8, it isassumed that an operator signs an agreement with a certain SP and the SPwholesales partial traffic, fees are not charged for traffic of certainsubscribers of the SP. The example shown in FIG. 8 mainly includes thefollowing steps:

S801

When a subscriber accesses the Internet, a user equipment requests agateway device (including a PCEF) to establish a data bearer channel fordata transmission.

S802

The gateway device reports information related to a service stream to aPCRF and requests a control policy, where the policy includes: QoS,gating, charging control policies, and so on.

S803

According to information related to a service stream that is provided bygateway device and in combination with the configured informationconfigured in the PCRF, subscription information from the outside,subscriber information or the account information of the subscriber, thePCRF makes a policy decision and determines an ordinary Internet accessrate group 1001 for the subscriber to access the Internet.

S804

The PCRF delivers a policy to the gateway device, where the policycarries the rate group 1001.

S805

The gateway device requests, based on the rate group 1001 delivered bythe PCRF, credit authorization from an online charging system.

S806

The online charging system determines a rate according to a subscribertype, a package type, a reward policy, rate group information, and soon, performs the credit authorization according to the rate and theaccount information of the subscriber, and returns corresponding creditauthorization to the gateway device.

S807

The subscriber uses a service, and the gateway device detects a usagecondition of the credit authorization, and after the subscriber passesauthentication of a specific service provider (Service Provider, SP),the SP gives a feedback to the operator that traffic of the subscriberis counted into the wholesale traffic and a fee is not charged for thetraffic of the subscriber.

S808

The PCRF entity receives application-layer information of the service,where the application-layer information is reported by an applicationfunction (Application Function, AF);

S809

Based on the application-layer information and/or a detection result,the PCRF entity remakes a policy decision, determines that a traffic feeis not charged for content download when the subscriber accesses the SP,and determines a higher-priority rate group 1003 indicating a rate of 0.

S810

The PCRF delivers a non-charging indication and the new rate group 1003to the gateway device.

S811

After receiving the indication, the gateway device reports service usageinformation (the reported information carries a Final-Unit-Indicationand the rate group 1003) of the subscriber that has already beencollected to the online charging system, and closes a charging sessionof the service after the reporting is complete.

S812

After receiving the service usage information reported by the gatewaydevice, the online charging system decides, according to priorities ofthe rate group 1001 and the rate group 1003, to perform fee deduction onthe reported service usage information by taking the rate group 1003 asa basis, and the online charging system does not charge for the reportedservice usage information because the rate group 1003 indicates the rateof 0, and if a fee has already been deducted, a return is performed.

Refer to FIG. 9, which is a schematic diagram of a logical structure ofa gateway device according to an embodiment of the present invention.For ease of description, only parts related to the embodiment of thepresent invention are presented. Functional modules/units included in agateway device that are shown in FIG. 9 may be software modules/units,hardware modules/units, or software-hardware combined modules/units, andinclude a rate group change determining module 901 and a charging datareporting module 902, where:

the rate group change determining module 901 is configured to determinewhether a rate group of a service data stream changes, where the rategroup has a priority attribute, that is, rate groups may have adifferent priority, so that the charging system is capable ofdetermining an appropriate rate group for service usage informationaccording to the priority of the rate group and performing chargingaccording to the determined rate group; and the charging data reportingmodule 902 is configured to report charging data to the charging systemif the rate group change determining module 901 determines that the rategroup of the service data stream changes, so that the charging systemperforms charging according to the charging data, where in thisembodiment, the charging data includes the service usage information anda reporting reason for reporting the charging data, and the reportingreason indicates a change of the rate group.

It should be noted that, in the preceding embodiment of the gatewaydevice, the division of each functional module is only an exemplarydescription. In practical applications, the preceding functions may beallocated, according to demands, for example, a requirement ofcorresponding hardware configuration or consideration of convenience insoftware implementation, to different functional modules for completion.That is to say, an internal structure of the gateway device is dividedinto different functional modules to complete all or a part of thefunctions described above. In addition, in practical applications, acorresponding functional module in this embodiment may be implemented bycorresponding hardware, and may also be completed by correspondinghardware by executing corresponding software. For example, the precedingrate group change determining module may be hardware executing thepreceding determining of the change of the rate group of the servicedata stream. For example, a rate group change determiner may also be anordinary processor or another hardware device that can execute acorresponding computer program to complete the preceding functions. Foranother example, the preceding charging data reporting module may alsobe hardware executing the preceding function of reporting, when the rategroup change determining module (or the rate group change determiner)determines that the rate group of the service data stream changes, thecharging data to the charging system. For example, a charging datareporter may also be an ordinary processor or another hardware devicethat can execute a corresponding computer program to complete thepreceding functions. The division of each functional module/unit in thefollowing embodiments is similar and will not be described herein again.

The rate group change determining module 901 shown in FIG. 9 may furtherinclude a first parsing unit 1001 and a first determining unit 1002, asshown in a gateway device, provided by another embodiment of the presentinvention, shown in FIG. 10, where:

the first parsing unit 1001 is configured to parse a service packet ofthe service data stream according to a service identification rule; and

the first determining unit 1002 is configured to re-determine, accordingto a parsed result and rate group configuration in the gateway device, arate group, and if the re-determined rate group is different from acurrent rate group, to determine that the rate group of the service datastream changes.

The rate group change determining module 901 shown in FIG. 9 may furtherinclude a first receiving unit 1101, a second parsing unit 1102, and asecond determining unit 1103, as shown in a gateway device, provided byanother embodiment of the present invention, shown in FIG. 11, where:

the first receiving unit 1101 is configured to receive an identificationrule and a corresponding charging control policy that are delivered by apolicy and charging rules function PCRF entity, where the chargingcontrol policy includes a rate group;

the second parsing unit 1102 is configured to parse a service packet ofthe service data stream according to the identification rule deliveredby the PCRF entity; and

the second determining unit 1103 is configured to match, according to aparsed result, the rate group delivered by the PCRF entity, so as tore-determine a rate group, and if the re-determined rate group isdifferent from a current rate group, to determine that the rate group ofthe service data stream changes.

The rate group change determining module 901 shown in FIG. 9 may furtherinclude a second receiving unit 1201, a third parsing unit 1202, and athird determining unit 1203, as shown in a gateway device, provided byanother embodiment of the present invention, shown in FIG. 12, where:

the second receiving unit 1201 is configured to receive anidentification rule identifier and a corresponding charging controlpolicy that are delivered by a policy and charging rules function PCRFentity, where the charging control policy includes a rate group;

the third parsing unit 1202 is configured to match, by using theidentification rule identifier delivered by the PCRF entity, anidentification rule configured in the gateway device, and parse theservice packet of the service data stream according to the matchedidentification rule; and

the third determining unit 1203 is configured to match, according to theparsed result, the rate group delivered by the PCRF entity, so as tore-determine a rate group, and if the re-determined rate group isdifferent from a current rate group, to determine that the rate group ofthe service data stream changes.

The rate group change determining module 901 shown in FIG. 9 may furtherinclude a third receiving unit 1301 and a fourth determining unit 1302,as shown in a gateway device, provided by another embodiment of thepresent invention, shown in FIG. 13, where:

the third receiving unit 1301 is configured to receive a chargingcontrol policy update command delivered by a policy and charging rulesfunction PCRF entity, where the charging control policy update commandincludes a rate group; and

the fourth determining unit 1302 is configured to: if the rate groupincluded in the charging control policy update command is different froma current rate group, determine that the rate group of the service datastream changes.

Refer to FIG. 14, which is a schematic diagram of a logical structure ofa charging system according to an embodiment of the present invention.For ease of description, only parts related to the embodiment of thepresent invention are presented. Functional modules/units included inthe charging system that are shown in FIG. 14 may be softwaremodules/units, hardware modules/units, or software-hardware combinedmodules/units, and include a charging data receiving module 1401, a ratedetermining module 1402, and a fee deducting module 1403, where:

the charging data receiving module 1401 is configured to receivecharging data reported by a gateway device when the gateway devicedetermines that a rate group of a service data stream changes, where thecharging data includes service usage information and a reporting reasonfor reporting the charging data, and the reporting reason indicates achange of the rate group;

the rate determining module 1402 is configured to determine a rate ofthe service data stream according to the reporting reason and anoriginal rate group; and

the fee deducting module 1403 is configured to perform, according to thedetermined rate, fee deduction on the service usage information.

In this embodiment, the rate group has a priority attribute, that is,rate groups may have a different priority.

Refer to FIG. 15, which is a schematic diagram of a logical structure ofa policy and charging rules function entity according to an embodimentof the present invention. For ease of description, only parts related tothe embodiment of the present invention are presented. Functionalmodules/units included in the PCRF entity that are shown in FIG. 15 maybe software modules/units, hardware modules/units, or software-hardwarecombined modules/units, and include a determining module 1501 and acharging control policy generating module 1502, where:

the determining module 1501 is configured to determine, according to anidentification result of identifying a service, whether it is necessaryto charge at a network layer and to deliver a charging control policy toa gateway device after generating the charging control policy, so thatthe gateway device executes the charging control policy; and

the charging control policy generating module 1502 is configured toregenerate, if it is confirmed that it is necessary to change thecharging control policy, a charging control policy and to deliver thecharging control policy to the gateway device.

In another embodiment of the present invention, the charging controlpolicy generating module 1502 is specifically configured to do asfollows: if that it is confirmed that it is necessary to change thecharging control policy is that it is confirmed that it is necessary tochange a rate group of a service data stream, the charging controlpolicy regenerated and delivered to the gateway device includes aregenerated rate group, so that the gateway device triggers reporting ofcharging data to the charging system. The charging data includes serviceusage information and a reporting reason for reporting the chargingdata, and the reporting reason indicates a change of the rate group. Inthis embodiment, the rate group has a priority.

The determining module 1501 shown in FIG. 15 may further include amatching unit 1601 and a generating unit 1602, as shown in a policy andcharging rules function entity, provided by another embodiment of thepresent invention, shown in FIG. 16, where:

the matching unit 1601 is configured to match a configuredidentification rule of the PCRF entity itself with service streaminformation reported by the gateway device; and

the generating unit 1602 is configured to: if the matching unit 1601fails to perform the matching successfully, confirm that a service is anunidentifiable service, and to generate a charging control policyincluding a low-priority rate group, so as to subsequently change therate group after the service identification and to recharge a used datastream.

Persons of ordinary skill in the art understand that all or part of thesteps of the methods in the embodiments may be implemented by a programinstructing relevant hardware. The program may be stored in a computerreadable storage medium, and the storage medium may be a read-onlymemory (ROM, Read Only Memory), a random access memory (RAM, RandomAccess Memory), a magnetic disk, an optical disk, or the like.

The preceding describes in detail a method for processing a rate group,a method for charging for a data service, and a related device andsystem that are provided by the embodiments of the present invention.Specific cases are applied or illustrating principles and theembodiments of the present invention. The foregoing description aboutthe embodiments is merely for ease of understanding the methods and coreideas of the present invention. Meanwhile, persons of ordinary skill inthe art may make modifications to specific implementation manners andapplication scopes according to the ideas of the present invention. Inconclusion, the content of this specification should not be construed asa limitation on the present invention.

What is claimed is:
 1. A charging method for a service, comprising:receiving, by a policy and charging rules function (PCRF) entity, amessage to request charging control policy from a gateway device when auser equipment accesses internet through the gateway device; sending, bythe PCRF entity, a response message to the gateway device, wherein theresponse message comprises a charging control policy of the service andan identification rule identifier for identifying an identification ruleof the service, so that the gateway device identify a data stream of theservice according to the an identification rule identifier and chargingthe data stream according to the charging control policy.
 2. The methodaccording to claim 1, wherein the charging control policy comprises arating group of the service.
 3. The method according to claim 1, whereinthe PCRF entity generating generates the charging control policyaccording to subscription information of the user equipment.
 4. Themethod according to claim 1, wherein the charging control policycomprises Quality of Service (QoS) information and gating information.5. The method according to claim 1, wherein the service is a streammedia service or peer-to-peer (P2P) download service.
 6. A policy andcharging rules function (PCRF) entity, comprising: a non-transitorymemory storage comprising instructions; and one or more processors incommunication with the memory, wherein the one or more processorsexecute the instructions for: receiving a message to request chargingcontrol policy from a gateway device when a user equipment accessesinternet through the gateway device; sending a response message to thegateway device, wherein the response message comprises a chargingcontrol policy and an identification rule identifier for identifying anidentification rule of the service, so that the gateway device identifya data stream of the service according to the an identification ruleidentifier and charging the data stream according to the chargingcontrol policy.
 7. The PCRF entity according to claim 6, wherein thecharging control policy comprises a rating group of the service.
 8. ThePCRF entity according to claim 6, wherein the charging control policy isgenerated according to subscription information of the user equipment.9. The PCRF entity according to claim 6, wherein the charging controlpolicy comprises Quality of Service (QoS) information and gatinginformation.
 10. The PCRF entity according to claim 6, wherein theservice is a stream media service or peer-to-peer (P2P) downloadservice.